home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume1 / awm / patch7 next >
Encoding:
Internet Message Format  |  1988-08-25  |  15.9 KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v01i013:  awm: Ardent Window Manager(X11), Patch7
  5. Message-ID: <1661@wyse.wyse.com>
  6. Date: 25 Aug 88 17:51:59 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 587
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: unido!meepmeep!jkh ( Jordan K. Hubbard )
  12. Posting-number: Volume 1, Issue 13
  13. Archive-name: awm/patch7
  14.  
  15. [The version I posted was already at patchlevel 6. -mcw]
  16.  
  17. Here is the last patch before R3. If you apply it (and the preceeding 6
  18. patches) to the awm found on decwrl.dec.com, you'll have the complete
  19. awm. I believe that you can do this to the one on expo too, I'm pretty
  20. sure that it matches the decwrl version. If you have the awm that came
  21. off of comp.sources.x, then just apply this patch.
  22.  
  23. All outstanding bugs have been fixed, there have been a few reports
  24. of bizarre behaviour, but they couldn't be reproduced at all. I think
  25. that some of them are due to operator error, some due to strange
  26. compilation environments. It works fine on the Sun 3 (running SunOS 3.5),
  27. the VAX and a few straight sysV machines.
  28.  
  29. Let me know if there's anything more I can do.
  30.  
  31.                 Jordan
  32.  
  33.  
  34. ---- patch 07 ----
  35. /*
  36.  * CHANGES:
  37.  *
  38.  * Invalid free() removed from gram.y.
  39.  * Transient window placement fixed.
  40.  * Signal handling done correctly for system V.
  41.  *
  42.  *
  43.  * UPDATED:
  44.  *
  45.  * awm.c now rev 1.5
  46.  * gram.y now rev 1.5
  47.  * GetButton.c now rev 1.5
  48.  *
  49.  */
  50.  
  51. diff -c awm/CHANGES awm.new/CHANGES
  52. *** awm/CHANGES    Fri Aug 19 14:28:15 1988
  53. --- awm.new/CHANGES    Wed Aug 17 13:25:32 1988
  54. ***************
  55. *** 1,9 ****
  56. ! This file last changed: 7/2/88
  57.   
  58.   The most recent changes to awm include:
  59.   
  60.   Border/title context rationalized, you may now have border contexts without
  61. ! title bars and vice-versa.
  62.   
  63.   The whole paradigm for adding/removing various decorations has changed.
  64.   Functions such as f.notitle and f.gadget have been replaced with the
  65. --- 1,17 ----
  66. ! This file last changed: 8/17/88
  67.   
  68.   The most recent changes to awm include:
  69.   
  70. + Invalid free() removed from gram.y.
  71. + Transient window placement fixed.
  72. + Signal handling done correctly for system V.
  73. + Previous changes to awm:
  74. + Changes as of 7/2/88:
  75.   Border/title context rationalized, you may now have border contexts without
  76. ! ntitle bars and vice-versa.
  77.   
  78.   The whole paradigm for adding/removing various decorations has changed.
  79.   Functions such as f.notitle and f.gadget have been replaced with the
  80. ***************
  81. *** 30,38 ****
  82.   including them in context information (for those who have removed them).
  83.   
  84.   Things have been sped up a bit.
  85. - Previous changes to awm:
  86.   
  87.   Version numbers set to 1.1 in all files. Subsequent versions of awm will
  88.   increment this accordingly (major_release.fix_level).
  89. --- 38,43 ----
  90. diff -c awm/Gadget.c awm.new/Gadget.c
  91. *** awm/Gadget.c    Fri Aug 19 14:29:30 1988
  92. --- awm.new/Gadget.c    Tue Aug 16 17:11:45 1988
  93. ***************
  94. *** 138,144 ****
  95.         if (ny < 0)
  96.              ny = 0;
  97.         if (dir == LeftGadgetGravity) {
  98. !            nx = lx + gdec->offset + GadgetBorder;
  99.              if (lx != 0) /* not first time through, add pad */
  100.               nx = lx + GadgetPad;
  101.              if (nx < 0)
  102. --- 138,144 ----
  103.         if (ny < 0)
  104.              ny = 0;
  105.         if (dir == LeftGadgetGravity) {
  106. !            nx = lx + gdec->offset;
  107.              if (lx != 0) /* not first time through, add pad */
  108.               nx = lx + GadgetPad;
  109.              if (nx < 0)
  110. diff -c awm/GetButton.c awm.new/GetButton.c
  111. *** awm/GetButton.c    Fri Aug 19 14:29:31 1988
  112. --- awm.new/GetButton.c    Fri Aug 19 13:52:16 1988
  113. ***************
  114. *** 3,9 ****
  115.   
  116.   
  117.   #ifndef lint
  118. ! static char *rcsid_GetButton_c = "$Header: GetButton.c,v 1.4 88/07/23 18:20:45 jkh Exp $";
  119.   #endif    lint
  120.   
  121.   #include "X11/copyright.h"
  122. --- 3,9 ----
  123.   
  124.   
  125.   #ifndef lint
  126. ! static char *rcsid_GetButton_c = "$Header: GetButton.c,v 1.5 88/08/19 15:55:45 jkh Exp $";
  127.   #endif    lint
  128.   
  129.   #include "X11/copyright.h"
  130. ***************
  131. *** 572,578 ****
  132.        XWMHints *XGetWMHints();
  133.        XWMHints *wmhints;
  134.        int x, y, w, h;
  135. !      Window transient_for;
  136.        Window jW;
  137.        int border_width, j;
  138.        Binding *bptr;
  139. --- 572,578 ----
  140.        XWMHints *XGetWMHints();
  141.        XWMHints *wmhints;
  142.        int x, y, w, h;
  143. !      Window transient_for = None;
  144.        Window jW;
  145.        int border_width, j;
  146.        Binding *bptr;
  147. ***************
  148. *** 616,628 ****
  149.              XFree(wmhints);
  150.         }
  151.        }
  152. !      else if ((awi = GetAwmInfo(window)) == NULL)
  153. !       awi = RegisterWindow(window);
  154.        if (awi->state & ST_WINDOW) {
  155. !       if (!transient_for)
  156. !            PlaceWindow(window);
  157. !       XMapRaised(dpy, awi->frame);
  158. !       XMapWindow(dpy, awi->client);
  159.         XSync(dpy, 0);
  160.        }
  161.        Leave_void
  162. --- 616,636 ----
  163.              XFree(wmhints);
  164.         }
  165.        }
  166. !      else { /* It's a transient */
  167. !       if (!(awi = GetAwmInfo(window)))
  168. !            awi = RegisterWindow(window);
  169. !       awi->attrs = AT_NONE;
  170. !       if (transient_for == None)
  171. !            transient_for = RootWindow(dpy, scr);
  172. !      }
  173.        if (awi->state & ST_WINDOW) {
  174. !       PlaceWindow(window, transient_for);
  175. !       if (awi->frame) {
  176. !            XMapRaised(dpy, awi->frame);
  177. !            XMapWindow(dpy, awi->client);
  178. !       }
  179. !       else
  180. !            XMapRaised(dpy, awi->client);
  181.         XSync(dpy, 0);
  182.        }
  183.        Leave_void
  184. ***************
  185. *** 660,667 ****
  186.        Leave_void
  187.   }
  188.   
  189. ! PlaceWindow(window)
  190.   Window window;
  191.   {
  192.        XSizeHints wsh;
  193.        int x, y, w, h;
  194. --- 668,676 ----
  195.        Leave_void
  196.   }
  197.   
  198. ! PlaceWindow(window, transient)
  199.   Window window;
  200. + Window transient;
  201.   {
  202.        XSizeHints wsh;
  203.        int x, y, w, h;
  204. ***************
  205. *** 675,681 ****
  206.        awi = GetAwmInfo(window);
  207.        XGetSizeHints(dpy, window, &wsh, XA_WM_NORMAL_HINTS);
  208.        CheckConsistency(&wsh);
  209. !      AskUser(dpy, scr, window, &x, &y, &w, &h, &wsh);
  210.   
  211.        wsh.flags |= (USPosition | USSize);
  212.        wsh.x = x;
  213. --- 684,690 ----
  214.        awi = GetAwmInfo(window);
  215.        XGetSizeHints(dpy, window, &wsh, XA_WM_NORMAL_HINTS);
  216.        CheckConsistency(&wsh);
  217. !      AskUser(dpy, scr, window, &x, &y, &w, &h, &wsh, transient);
  218.   
  219.        wsh.flags |= (USPosition | USSize);
  220.        wsh.x = x;
  221. ***************
  222. *** 730,736 ****
  223.   
  224.        height = xwc->height;
  225.        width = xwc->width;
  226. !      x = y = 0;
  227.        /* width */
  228.        xwc->width += bch;
  229.        if (awi->title)
  230. --- 739,750 ----
  231.   
  232.        height = xwc->height;
  233.        width = xwc->width;
  234. !      if (awi->frame)
  235. !       x = y = 0;
  236. !      else {
  237. !       x = xwc->x;
  238. !       y = xwc->y;
  239. !      }
  240.        /* width */
  241.        xwc->width += bch;
  242.        if (awi->title)
  243. ***************
  244. *** 757,763 ****
  245.              xwc->y -= (BContext + (awi->border_width ?
  246.                         awi->border_width : 1));
  247.        }
  248. !      XConfigureWindow(dpy, awi->frame, mask, xwc);
  249.        if (awi->gadgets)
  250.         PutGadgets(w);
  251.        xwc->width = width;
  252. --- 771,778 ----
  253.              xwc->y -= (BContext + (awi->border_width ?
  254.                         awi->border_width : 1));
  255.        }
  256. !      if (awi->frame)
  257. !           XConfigureWindow(dpy, awi->frame, mask, xwc);
  258.        if (awi->gadgets)
  259.         PutGadgets(w);
  260.        xwc->width = width;
  261. diff -c awm/Iconify.c awm.new/Iconify.c
  262. *** awm/Iconify.c    Fri Aug 19 14:28:25 1988
  263. --- awm.new/Iconify.c    Wed Aug 17 11:23:00 1988
  264. ***************
  265. *** 127,133 ****
  266.             from = awi->icon;
  267.             to = (awi->frame) ? awi->frame : awi->client;
  268.         if (!(awi->state & ST_PLACED))
  269. !            PlaceWindow(to);
  270.        }
  271.        else if (awi->state & ST_WINDOW) {
  272.             from = (awi->frame) ? awi->frame : awi->client;
  273. --- 127,133 ----
  274.             from = awi->icon;
  275.             to = (awi->frame) ? awi->frame : awi->client;
  276.         if (!(awi->state & ST_PLACED))
  277. !            PlaceWindow(to, None);
  278.        }
  279.        else if (awi->state & ST_WINDOW) {
  280.             from = (awi->frame) ? awi->frame : awi->client;
  281. diff -c awm/README awm.new/README
  282. *** awm/README    Fri Aug 19 14:29:59 1988
  283. --- awm.new/README    Fri Aug 19 15:02:32 1988
  284. ***************
  285. *** 1,3 ****
  286. --- 1,24 ----
  287. + This file last changed August 19th, 1988.
  288. + Since the first netwide release, the author has fled the country
  289. + and is now residing in West Germany where he may sometimes be found sitting
  290. + atop a mountain in the alps, muttering to himself about the
  291. + ICCCM. Ardent Computer Corp (mentioned below) is the owner of
  292. + this code but the author has agreed to continue maintainance, where
  293. + practical, and should be contacted as well in case of difficulty.
  294. + Through the wonders of e-mail, even West Germany does not appear to
  295. + be far enought away to escape responsibility.
  296. +                 Jordan Hubbard
  297. +                                 PCS Computer Systeme GmbH
  298. +                                 Pfaelzer-Wald-Str. 36
  299. +                                 D-8000 Muenchen 90.
  300. +                                 West Germany
  301. +                 uunet!unido!pcsbst!jkh
  302. + -------
  303.   This represents the first real release of the Ardent Window Manager (awm).
  304.   It's being released on the same terms as its predecessor (uwm) with
  305.   one additional request: Since this window manager is the "official"
  306. diff -c awm/RubberBand.c awm.new/RubberBand.c
  307. *** awm/RubberBand.c    Fri Aug 19 14:28:45 1988
  308. --- awm.new/RubberBand.c    Thu Aug 18 11:48:22 1988
  309. ***************
  310. *** 73,84 ****
  311.   #define BW    PBorderWidth        /* pop-up window border width */
  312.   #define IBW    PPadding        /* internal border width for pop-up */
  313.   
  314. ! AskUser(dpy, scr, window, x, y, width, height, hints)
  315.   Display *dpy;
  316.   int scr;
  317.   Window window;
  318.   int *x, *y, *width, *height;
  319.   XSizeHints *hints;
  320.   {
  321.        Cursor ur, ul, ll, lr;          /* cursors for rubber banding    */
  322.        int change_cursor = FALSE;
  323. --- 73,85 ----
  324.   #define BW    PBorderWidth        /* pop-up window border width */
  325.   #define IBW    PPadding        /* internal border width for pop-up */
  326.   
  327. ! AskUser(dpy, scr, window, x, y, width, height, hints, transient)
  328.   Display *dpy;
  329.   int scr;
  330.   Window window;
  331.   int *x, *y, *width, *height;
  332.   XSizeHints *hints;
  333. + Window transient;
  334.   {
  335.        Cursor ur, ul, ll, lr;          /* cursors for rubber banding    */
  336.        int change_cursor = FALSE;
  337. ***************
  338. *** 102,119 ****
  339.        int doit = FALSE;
  340.        int dx, dy;
  341.        int delta;
  342.        XPoint box[PCOUNT];
  343.        int hsize, vsize;
  344.        int zero = '0';                 /* zero offset for char conversion  */
  345.        XEvent e;                 /* someplace to put the event   */
  346.        int events;                     /* what events we want.             */
  347. !      Window pop;                     /* pop up prompt window         */
  348.        int i;
  349.        char *name;
  350.        int width_offset, height_offset; /* to subtract if resize increments */
  351.        
  352.        Entry("AskUser")
  353. !      
  354.        if ((hints->flags & USPosition) && (hints->flags & USSize)) {
  355.         *x = hints->x;
  356.         *y = hints->y;
  357. --- 103,126 ----
  358.        int doit = FALSE;
  359.        int dx, dy;
  360.        int delta;
  361. +      int ijunk;
  362.        XPoint box[PCOUNT];
  363.        int hsize, vsize;
  364.        int zero = '0';                 /* zero offset for char conversion  */
  365.        XEvent e;                 /* someplace to put the event   */
  366.        int events;                     /* what events we want.             */
  367. !      Window pop, wjunk;                     /* pop up prompt window         */
  368.        int i;
  369.        char *name;
  370.        int width_offset, height_offset; /* to subtract if resize increments */
  371.        
  372.        Entry("AskUser")
  373. !      if (transient) {
  374. !       XGetGeometry( dpy, window, &wjunk, x, y, width, height,
  375. !                &ijunk, &ijunk);
  376. !       Leave_void
  377. !      }
  378.        if ((hints->flags & USPosition) && (hints->flags & USSize)) {
  379.         *x = hints->x;
  380.         *y = hints->y;
  381. diff -c awm/XRdBitFD.c awm.new/XRdBitFD.c
  382. *** awm/XRdBitFD.c    Fri Aug 19 14:28:52 1988
  383. --- awm.new/XRdBitFD.c    Fri Aug 19 14:46:55 1988
  384. ***************
  385. *** 31,37 ****
  386.   
  387.   #include "copyright.h"
  388.   
  389. ! #include "Xos.h"
  390.   #include "X11/Xlib.h"
  391.   #include "X11/Xutil.h"
  392.   #include "Xlibint.h"
  393. --- 31,38 ----
  394.   
  395.   #include "copyright.h"
  396.   
  397. ! /* Jim says Xos is in X11 now, so... */
  398. ! #include "X11/Xos.h"
  399.   #include "X11/Xlib.h"
  400.   #include "X11/Xutil.h"
  401.   #include "Xlibint.h"
  402. diff -c awm/awm.c awm.new/awm.c
  403. *** awm/awm.c    Fri Aug 19 14:30:02 1988
  404. --- awm.new/awm.c    Fri Aug 19 13:51:32 1988
  405. ***************
  406. *** 3,9 ****
  407.   
  408.   
  409.   #ifndef lint
  410. ! static char *rcsid_awm_c = "$Header: awm.c,v 1.4 88/07/24 01:24:56 jkh Exp $";
  411.   #endif  lint
  412.   
  413.   #include "X11/copyright.h"
  414. --- 3,9 ----
  415.   
  416.   
  417.   #ifndef lint
  418. ! static char *rcsid_awm_c = "$Header: awm.c,v 1.5 88/08/19 15:55:56 jkh Exp $";
  419.   #endif  lint
  420.   
  421.   #include "X11/copyright.h"
  422. ***************
  423. *** 61,67 ****
  424. --- 61,69 ----
  425.    * 003 -- Jordan Hubbard, Ardent Computer. Added gadgets, border contexts.
  426.    */
  427.   
  428. + #ifndef PCS
  429.   #include <sys/time.h>
  430. + #endif
  431.   #include <signal.h>
  432.   #if defined(vax)
  433.   #include <sys/file.h>
  434. ***************
  435. *** 73,78 ****
  436. --- 75,84 ----
  437.   #include "X11/Xutil.h"
  438.   #include "X11/cursorfont.h"
  439.   
  440. + #ifdef PCS
  441. + #include <unistd.h>
  442. + #include <bsd/sys/time.h>
  443. + #endif
  444.   #ifdef PROFIL
  445.   #include <signal.h>
  446.   /*
  447. ***************
  448. *** 287,296 ****
  449.         * Catch some of the basic signals so we don't get rudely killed without
  450.         * cleaning up first.
  451.         */
  452. !      signal(SIGHUP, Quit);
  453. !      signal(SIGTERM, Quit);
  454. !      signal(SIGQUIT, Quit);
  455. !      signal(SIGINT, Quit);
  456.   
  457.        /*
  458.         * If the root window has not been named, name it.
  459. --- 293,306 ----
  460.         * Catch some of the basic signals so we don't get rudely killed without
  461.         * cleaning up first.
  462.         */
  463. !      if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
  464. !       signal(SIGHUP, Quit);
  465. !      if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
  466. !       signal(SIGTERM, Quit);
  467. !      if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
  468. !       signal(SIGTERM, Quit);
  469. !      if (signal(SIGINT, SIG_IGN) != SIG_IGN)
  470. !       signal(SIGINT, Quit);
  471.   
  472.        /*
  473.         * If the root window has not been named, name it.
  474. ***************
  475. *** 896,902 ****
  476.   int *wide, *high;
  477.   {
  478.        char *cp, *cp2;
  479. !      
  480.        Entry("GetPixmapDataRes")
  481.        
  482.        if ((cp = XGetDefault(dpy, NAME, string)) ||
  483. --- 906,912 ----
  484.   int *wide, *high;
  485.   {
  486.        char *cp, *cp2;
  487.        Entry("GetPixmapDataRes")
  488.        
  489.        if ((cp = XGetDefault(dpy, NAME, string)) ||
  490. diff -c awm/awm.h awm.new/awm.h
  491. *** awm/awm.h    Fri Aug 19 14:29:44 1988
  492. --- awm.new/awm.h    Fri Aug 19 15:09:33 1988
  493. ***************
  494. *** 66,72 ****
  495. --- 66,76 ----
  496.    
  497.   #include <errno.h>
  498.   #include <stdio.h>
  499. + #ifdef SYSV
  500. + #include <string.h>
  501. + #else
  502.   #include <strings.h>
  503. + #endif
  504.   #include "X11/Xlib.h"
  505.   #include "X11/Intrinsic.h"
  506.   #include "X11/Xatom.h"
  507. diff -c awm/exp_path.c awm.new/exp_path.c
  508. *** awm/exp_path.c    Fri Aug 19 14:29:04 1988
  509. --- awm.new/exp_path.c    Wed Aug 10 13:30:17 1988
  510. ***************
  511. *** 27,32 ****
  512. --- 27,35 ----
  513.    *
  514.    */
  515.   
  516. + #ifdef PCS
  517. + #include <unistd.h>
  518. + #endif
  519.   #include <pwd.h>
  520.   #include <stdio.h>
  521.   #if defined(vax)
  522. diff -c awm/gram.y awm.new/gram.y
  523. *** awm/gram.y    Fri Aug 19 14:30:04 1988
  524. --- awm.new/gram.y    Fri Aug 19 13:59:43 1988
  525. ***************
  526. *** 59,65 ****
  527.   
  528.   
  529.   #ifndef lint
  530. ! static char *rcsid_gram_y = "$Header: gram.y,v 1.4 88/07/24 01:01:04 jkh Exp $";
  531.   #endif    lint
  532.   
  533.   #include "X11/Xlib.h"
  534. --- 59,65 ----
  535.   
  536.   
  537.   #ifndef lint
  538. ! static char *rcsid_gram_y = "$Header: gram.y,v 1.5 88/08/19 15:55:04 jkh Exp $";
  539.   #endif    lint
  540.   
  541.   #include "X11/Xlib.h"
  542. ***************
  543. *** 590,596 ****
  544.        Entry("keywordlookup")
  545.   
  546.        for (i = 0; KeywordTable[i].name; i++) {
  547. !       if (!strcmp(KeywordTable[i].name, string)) {
  548.              free(string);
  549.              Leave(i)
  550.         }
  551. --- 590,596 ----
  552.        Entry("keywordlookup")
  553.   
  554.        for (i = 0; KeywordTable[i].name; i++) {
  555. !           if (!strcmp(KeywordTable[i].name, string)) {
  556.              free(string);
  557.              Leave(i)
  558.         }
  559. ***************
  560. *** 1002,1008 ****
  561.              tmp->high = gray_height;
  562.              tmp->wide = gray_width;
  563.         }
  564. -       free(s);
  565.         if (tmp->high > gadgetHeight)
  566.              gadgetHeight = tmp->high;
  567.        }
  568. --- 1002,1007 ----
  569. diff -c awm/lex.l awm.new/lex.l
  570. *** awm/lex.l    Thu Jun 16 09:40:29 1988
  571. --- awm.new/lex.l    Thu Aug 11 13:22:02 1988
  572. ***************
  573. *** 93,98 ****
  574. --- 93,100 ----
  575.       char *ptr;
  576.       char *malloc();
  577.   
  578. +     if (!s || !strlen(s))
  579. +     return(NULL);
  580.       ptr = malloc(strlen(s) + 1);
  581.       if (ptr == NULL) {
  582.           Error("out of space");
  583.  
  584. -- 
  585. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  586.